package cn.com.dhcc.adam.log;

import java.util.logging.ConsoleHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.XMLFormatter;

public class DoSomething {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Logger logger = Logger.getLogger(DoSomething.class.getName());
		

		Handler consoleHandler = new ConsoleHandler();
		consoleHandler.setLevel(Level.WARNING);
		consoleHandler.setFormatter(new XMLFormatter());
		logger.addHandler(consoleHandler);
		
		logger.log(Level.WARNING, "This is a warning!");
		//logger.setLevel(Level.WARNING);
		logger.log(Level.INFO, "This is a INFO!");
		logger.log(Level.WARNING, "This is a warning!");
		logger.log(Level.SEVERE, "This is a SEVERE!");
		logger.log(Level.FINER, "This is a FINER!");
		
		
	}

}
